<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<div id="sample">
foo<span style="-webkit-user-select: none;">bar</span>
</div>
<div id="log"></div>
<script>
test(function() {
    var selection = window.getSelection();
    var sample = document.getElementById('sample');
    selection.collapse(sample, 0);
    document.execCommand('selectAll');
    assert_equals(selection.anchorNode, sample.firstChild, 'anchorNode');
    assert_equals(selection.anchorOffset, 1, 'anchorOffset');
    assert_equals(selection.focusNode, sample.firstChild, 'focusNode');
    assert_equals(selection.focusOffset, 4, 'focusOffset');
}, 'user-select:none means content of element is not select-able');
</script>
